﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq;

namespace QFlow.Data
{
    public static class AccountingEventExtension
    {
        public static AccountingEvent GetLoginEvent(this Table<AccountingEvent> queriable)
        {
            return queriable.Single(e => e.AccountingEventID == 1);
        }

        public static AccountingEvent GetLogoutEvent(this Table<AccountingEvent> queriable)
        {
            return queriable.Single(e => e.AccountingEventID == 2);
        }

        public static AccountingEvent GetChangeCreditEvent(this Table<AccountingEvent> queriable)
        {
            return queriable.Single(e => e.AccountingEventID == 3);
        }

        public static AccountingEvent GetResetEvent(this Table<AccountingEvent> queriable)
        {
            return queriable.Single(e => e.AccountingEventID == 4);
        }
    }
}
